/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.org.jhsystem.consola.properties;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 *
 * @author jhuamanv
 */
public class PropertiesUtil {

    private Properties pro;

    public PropertiesUtil() {
    }

    public Properties getPro() {
        return pro;
    }

    public void setPro(Properties pro) {
        this.pro = pro;
    }

    public void CargarConfiguraciones() {
        pro=new Properties();
        InputStream is = null;
        /*try {
            pro.load(this.getClass().getResource("consola_ES.properties").openStream());

        } catch (IOException ex) {
            ex.printStackTrace();
        }*/
        try {
            is=new FileInputStream("consola_ES.properties");
            pro.load(is);
            String data1 = pro.getProperty("data1");
            String data2 = pro.getProperty("data2");
            System.out.println("Valores recuperados: "+data1+" - "+data2);
        } catch(IOException ioe) {
            ioe.printStackTrace();
        }
    }
}
